<template>
<ul class="todo-main">
<!--  :msg="todoObj" v-for="todoObj in msg" todo :key="todoObj.id"-->
<!--将数据传递给子组件-->
  <transition-group name="todo" appear>
      <my-item :todos="todoObj"
               v-for="todoObj in todos"
               :key="todoObj.id"
      />
  </transition-group>
</ul>

</template>

<script>
import MyItem from "../components/MyItem";
export default {
  name: "MyList",
  components: {
    MyItem,
  },
  //接收父组件传递过来的数据
  props:['todos']
}
</script>

<style>
/*main*/
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}
/*过渡 进入时的效果*/
.todo-enter-active{
  animation: athyjs 0.5s;
}
/*过渡 离开时的效果*/
.todo-leave-active{
  animation: athyjs 0.5s reverse;
}
/*离开或进入时的样式*/
@keyframes athyjs {
  from{
    transform: translateX(100%);
  }
  to{
    transform: translateX(0px);
  }
}
</style>